<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
<!--<title><?php echo ($mob_seo['title']); ?> | <?php echo modC('WEBSITE_NAME','OpenSNS','Mob');?></title>  -->
<title> 有乎儿</title>
<meta name="keywords" content="<?php echo ($mob_seo['keywords']); ?>">
<meta name="description" content="<?php echo ($mob_seo['description']); ?>">

<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="format-detection" content="telephone=no">
<meta name="renderer" content="webkit">
<meta http-equiv="Cache-Control" content="no-siteapp"/>

<script src="/os/Application/Mob/Static/js/jquery.min.js"></script>
<script src="/os/Application/Mob/Static/js/amazeui.min.js"></script>
<script src="/os/Public/js/com/com.functions.js"></script>
<script src="/os/Application/Mob/Static/js/toast.js"></script>
<script src="/os/Application/Mob/Static/js/apps/base.js"></script>


<script src="/os/Public/js/ext/magnific/jquery.magnific-popup.min.js"></script>
<script src="/os/Application/Mob/Static/js/toastr/toastr.min.js"></script>
<script src="/os/Application/Mob/Static/js/toast.js"></script>
<script src="/os/Application/Mob/Static/js/dist/lrz.mobile.min.js"></script>

<link rel="stylesheet" href="/os/Application/Mob/Static/css/amazeui.min.css"/>




<link rel="stylesheet" href="/os/Application/Mob/Static/css/app.css"/>
<link rel="stylesheet" href="/os/Application/Mob/Static/js/toastr/toastr.min.css" />
<link rel="stylesheet" href="/os/Application/Mob/Static/js/diyUpload.css"/>
<link rel="stylesheet" href="/os/Application/Mob/Static/css/apps/core.css"/>
<link rel="stylesheet" href="/os/Public/js/ext/magnific/magnific-popup.css"/>
<link rel="alternate icon" type="image/png" href="assets/i/favicon.png">
<!--用于加载顶部css和js-->
<?php $config = api('Config/lists'); C($config); $count_code=C('_MOB_STATISTICALCODE'); if(empty($count_code)){ $count_code=C('COUNT_CODE'); } ?>

<script type="text/javascript">
    //全局内容的定义
    var _ROOT_ = "/os";
    var MID = "<?php echo is_login();?>";
    var MODULE_NAME="<?php echo MODULE_NAME; ?>";
    var ACTION_NAME="<?php echo ACTION_NAME; ?>";
    var CONTROLLER_NAME ="<?php echo CONTROLLER_NAME; ?>";
    var ThinkPHP = window.Think = {
        "ROOT": "/os", //当前网站地址
        "APP": "/os/index.php?s=", //当前项目地址
        "PUBLIC": "/os/Public", //项目公共目录地址
        "DEEP": "<?php echo C('URL_PATHINFO_DEPR');?>", //PATHINFO分割符
        "MODEL": ["<?php echo C('URL_MODEL');?>", "<?php echo C('URL_CASE_INSENSITIVE');?>", "<?php echo C('URL_HTML_SUFFIX');?>"],
        "VAR": ["<?php echo C('VAR_MODULE');?>", "<?php echo C('VAR_CONTROLLER');?>", "<?php echo C('VAR_ACTION');?>"],
        'URL_MODEL': "<?php echo C('URL_MODEL');?>",
        'WEIBO_ID': "<?php echo C('SHARE_WEIBO_ID');?>"
    }

    var weibo_comment_order = "<?php echo modC('COMMENT_ORDER',0,'WEIBO');?>";
</script>

<script>
    //全局内容的定义
    var _LOADING_ = "/os/Application/Mob/Static/images/loading.jpg";
</script>
    </head>
    <body>
        <!-- 头部 -->
        <?php D('Member')->need_login(); ?>
<style>
    .header {
        text-align: center;
    }

    .header h1 {
        font-size: 200%;
        color: #333;
        margin-top: 30px;
    }

    .header p {
        font-size: 14px;
    }
</style>
<div data-am-widget="header" class="am-header am-header-default am-header-fixed am-cf">
    <?php if(!empty($top_menu_list["left"])): ?><div class="am-header-left am-header-nav">

            <?php if(is_array($top_menu_list["left"])): $i = 0; $__LIST__ = $top_menu_list["left"];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$menu): $mod = ($i % 2 );++$i; switch($menu["type"]): case "home": ?><a href="<?php echo ($menu["href"]); ?>" class="am-fl <?php echo ($menu["a_class"]); ?>">
                            <i class="am-header-icon am-icon-home <?php echo ($menu["i_class"]); ?>"></i><?php echo ($menu["html"]); ?>
                        </a><?php break;?>
                    <?php case "back": ?><a id="goback" need-confirm="<?php echo ($menu["need_confirm"]); ?>" confirm-info="<?php echo ($menu["confirm_info"]); ?>"
                           class="<?php echo ($menu["a_class"]); ?>">
                            <span class="am-icon-chevron-left <?php echo ($menu["span_class"]); ?>"></span>
                        </a><?php break;?>
                    <?php case "message": if (is_login()) { ?>
                        <?php echo W('Mob/Message/index');?>
                        <?php } break; endswitch; endforeach; endif; else: echo "" ;endif; ?>
        </div><?php endif; ?>

    <h1 class="am-header-title <?php echo ($top_menu_list["center"]["h1_class"]); ?>">
        <i class="<?php echo ($top_menu_list["center"]["i_class"]); ?>"></i>
        <?php echo ((isset($top_menu_list["center"]["title"]) && ($top_menu_list["center"]["title"] !== ""))?($top_menu_list["center"]["title"]):"首页"); ?>
    </h1>
    <?php if(!empty($top_menu_list["right"])): ?><div class="am-header-right am-header-nav">
            <?php if(is_array($top_menu_list["right"])): $i = 0; $__LIST__ = $top_menu_list["right"];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$right): $mod = ($i % 2 );++$i; switch($right["type"]): case "edit": if(isset($right['href'])): ?><a href="<?php echo ($right['href']); ?>" class="am-fl <?php echo ($right["a_class"]); ?>">
                        <!-- <a href="<?php echo U('Mob/Task/addTask');?>" class="am-fl <?php echo ($right["a_class"]); ?>"> -->

                                <i class="am-header-icon am-icon-pencil <?php echo ($right["i_class"]); ?>"></i>
                            </a>
                            <?php else: ?>
                            <script>
                                var tip_info="<?php echo ($right['info']); ?>";
                            </script>
                            <a class="am-fl <?php echo ($right['a_class']); ?>" href="javascript:void(0);" onclick="toast.error(tip_info)">
                                <i class="am-header-icon am-icon-pencil <?php echo ($right["i_class"]); ?>"></i>
                            </a><?php endif; break; endswitch; endforeach; endif; else: echo "" ;endif; ?>
            <a href="#" class="">
            </a>
        </div><?php endif; ?>
</div>
<?php if(CONTROLLER_NAME != 'Index'): ?><link href="/os/Application/Mob/Static/js/toastr/toastr.min.css" rel="stylesheet"/>

<div id="demo-view" class="" data-backend-compiled="" style="z-index: 1040">
    <nav data-am-widget="menu" class="am-menu am-menu-offcanvas1 am-no-layout" data-am-menu-offcanvas=""><a
            href="javascript: void(0)" class="am-menu-toggle"><i class="am-menu-toggle-icon am-icon-bars"></i></a>

        <div class="am-offcanvas "
             style="touch-action: pan-y; -webkit-user-select: none; -webkit-user-drag: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);">
            <div class="am-offcanvas-bar am-offcanvas-bar-flip">
                <div class="am-text-center" id="user" style="display: none">
                    <?php $user=query_user(array('nickname','avatar64')); ?>
                    <?php $map = array('status' => array('gt', -1), 'pid' => 0,'url'=>array('eq','mob/user/index')); $list=D('MobChannel')->where($map)->find(); if($list){ ?>
                    <a style="text-indent: 0px;" href="<?php echo U('mob/user/index');?>">
                        <img class="avatar-img" style="border-radius: 100%;width:64px;margin-top:20px "
                             src="<?php echo ($user["avatar64"]); ?>">
                    </a><?php }else{ ?>
                    <a style="text-indent: 0px;" >
                        <img class="avatar-img" style="border-radius: 100%;width:64px;margin-top:20px "
                             src="<?php echo ($user["avatar64"]); ?>">
                    </a>
                    <?php } ?>

                    <div class="am-text-center">
                        <a class="am-text-truncate" style="color: #fff; width: 81px;
  display: block;
  margin: 0 auto;"><?php echo ($user["nickname"]); ?></a>
                    </div>
                </div>
                <div class="am-text-center" id="signin"
                     style="display: block;font-size: 18px ; height: 44px;line-height: 44px;">
                    <a href="<?php echo U('mob/Member/index');?>">
                        <i class="am-icon-sign-in"></i>
                        &nbsp;&nbsp;&nbsp;登录
                    </a>
                </div>
                <ul class="am-menu-nav am-avg-sm-1 am-text-center">

                    <?php $map = array('status' => array('gt', -1), 'pid' => 0,'url'=>array('neq','mob/user/index')); $list=D('MobChannel')->where($map)->select(); foreach($list as &$v ){ $v['url']=U($v['url']); } ?>
                    <?php if(is_array($list)): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><li>
                            <a style="text-indent: 0px;" href="<?php echo ($vo["url"]); ?>">
                                <i class="<?php echo ($vo["icon"]); ?>"></i>
                                &nbsp;&nbsp;&nbsp;<?php echo ($vo["title"]); ?>
                            </a>
                        </li><?php endforeach; endif; else: echo "" ;endif; ?>



                    <?php if (is_login()) { ?>
                   <!--
                    <li>
                        <a style="text-indent: 0px;" href="<?php echo U('message/index');?>" class="am-icon-bell-o">
                            <i ></i>
                            &nbsp;&nbsp;&nbsp;消息
                        </a>
                    </li>
                    -->
                    <?php } ?>
                </ul>
                <div class="am-text-center" id="signout" style="display: none;padding: 5px 0px">
                    <a>
                        <i class="am-icon-sign-out"></i>
                        &nbsp;&nbsp;&nbsp;退出
                    </a>
                </div>
            </div>
        </div>
    </nav>
</div>
<script src="/os/Application/Mob/Static/js/toastr/toastr.min.js"></script>
<script src="/os/Application/Mob/Static/js/toast.js"></script>
<script>
    var uid = '<?php echo is_login();?>';
    $(document).ready(function () {
        signout();
        if (uid > 0) {
            $('#user').show()
            $('#signin').hide()
            $('#signout').show()
        } else {
            $('#user').hide()
            $('#signin').show()
            $('#signout').hide()
        }

    });

    var signout = function () {
        $('#signout').click(function () {
            $.post("<?php echo U('Mob/Member/logout');?>", {}, function (msg) {
                if (msg.status == 1) {
                    setTimeout(function () {
                        window.location.reload();
                    }, 2000);
                    toast.success('退出成功!');
                } else {
                    toast.error(msg.info);
                }
            }, 'json')
        });
    }
</script><?php endif; ?>



        <!-- /头部 -->

        <!-- 主体 -->
        

<div id="mob-main-container" class="container">
   
     <link href="/os/Application/Mob/Static/css/apps/bootstrap--bottom.css" rel="stylesheet">
    <script src="/os/Application/Mob/Static/js/jquery-1.11.3.min.js"></script>
    <script src="/os/Application/Mob/Static/js/bootstrap.min.js"></script>
  </head>
  <body>
     <nav>
     <!-- <a class="forward navbar-btn navbar-fixed-bottom btn btn-danger" style="border-radius:15px;" href="#">添加班组</a>  -->

     </nav>
      <div class="btn-group">
  <label class="btn btn-primary" onClick="javascript:location.href='<?php echo U('Mob/Teacher/myclasses');?>'" >
    <input type="radio" name="options" value="班级" id="option1" hidden=""> 班级
  </label>
  <label class="btn btn-primary" onClick="javascript:location.href='<?php echo U('Mob/Teacher/classSignRecord');?>'">
    <input type="radio" name="options" value="签到" id="option2" hidden="" >签到
  </label>
  <label class="btn btn-primary" onClick="javascript:location.href='<?php echo U('Mob/Teacher/classLeaveApproval');?>'" >
    <input type="radio" name="options" value="签到" id="option3" hidden="" >请假
  </label>
  <label class="btn btn-primary " onClick="javascript:location.href='<?php echo U('Mob/Teacher/classStatistics');?>'" >
    <input type="radio" name="options" value="签到" id="option4" hidden="" >统计
  </label>
   <label class="btn btn-primary  active" >
    <input type="radio" name="options" value="管理" id="option5" hidden="" >管理
  </label>
 </div>

 <div style="margin-top:5px;">
 <a href="<?php echo U('Mob/Teacher/peopleManage');?>" class="btn btn-default ">老师管理</a>
 <a href="" class="btn btn-default  active" style="5px;">设定签到时间</a>
 </div>

<?php if(!empty($orga)): ?><div align="center">
        <input name="schooId" type="hidden" id="schooId" value="<?php echo ($orga["schooId"]); ?>" />
        <input name="orgaId" type="hidden" id="orgaId" value="<?php echo ($orga["orgaId"]); ?>" />
        <div class="span12">
            <div class="well">
                <div><span>设定签到起始时间</span></div>
               <input class="time" id="signStartTime" type="text" size="10" value="<?php echo ($signParam["signStartTime"]); ?>" readonly onclick="_SetTime(this)"/>

        <div style="margin-top:5px"><span>设定签到结束时间</span></div>
               <input class="time" id="signEndTime" type="text" size="10" value="<?php echo ($signParam["signEndTime"]); ?>" readonly onclick="_SetTime(this)"/>

            </div>
<div align="center">
            <input type="button"  id = "settingSubmit" class="btn btn-primary" value="点击签到">
             <a class="btn btn-primary">返回</a>
</div>
         </div>
</div>
<script type="text/javascript">
    var str = "";
    document.writeln("<div id=\"_contents\" style=\"padding:5px;background-color:#ECF7FE;font-size:12px;border:1px solid #CFD1D5;position:absolute;left:?px; top:?px; width:?px; height:?px;z-index:1;visibility:hidden\">");
    str += "时<select id=\"_hour\">";

    for (h = 0; h <= 23; h++) {
        if(h >=0 && h<=9)
           str += "<option value=\"0" + h + "\">0" + h + "</option>";
        else
           str += "<option value=\"" + h + "\">" + h + "</option>";
    }

    str += "</select> 分<select id=\"_minute\">";
    for (m = 0; m <= 59; m++) {
        if(m >=0 && m<=9)
           str += "<option value=\"0" + m + "\">0" + m + "</option>";
        else
           str += "<option value=\"" + m + "\">" + m + "</option>";

    }



    str += "</select> <input type=\"button\" onclick=\"_select()\" value=\"\确定\" /> <input type=\"button\" onclick=\"_clear()\" value=\"\清除\" /></div>";
    document.writeln(str);

    var _fieldname;

    function _SetTime(tt) {
        _fieldname = tt;
        var ttop = tt.offsetTop;    //TT控件的定位点高
        var thei = tt.clientHeight;    //TT控件本身的高
        var tleft = tt.offsetLeft;    //TT控件的定位点宽
        while (tt = tt.offsetParent) {
            ttop += tt.offsetTop;
            tleft += tt.offsetLeft;
        }
        document.all._contents.style.top = ttop + thei + 4;
        document.all._contents.style.left = tleft;
        document.all._contents.style.visibility = "visible";
    }

    function _select() {
        _fieldname.value = document.all._hour.value+":"+ document.all._minute.value+":00";
        document.all._contents.style.visibility = "hidden";
    }

    function _clear() {
        document.all._hour.value = document.all._minute.value = "00";
        _fieldname.value = "";
        document.all._contents.style.visibility = "hidden";
    }

    document.onclick = function(e){
        e = window.event||e;
        obj = e.srcElement ? e.srcElement : e.target;
        if(obj.className != "time" && obj.id != "_contents" && obj.id != "_hour" && obj.id != "_minute" && obj.id != "_second"){
            document.all._contents.style.visibility = "hidden";
        }
    };
</script>

<script>



$('#settingSubmit').bind('click',function(){
var signStartTime = document.getElementById('signStartTime').value;
var signEndTime = document.getElementById('signEndTime').value;
var schooId = document.getElementById('schooId').value;
var orgaId  = document.getElementById('orgaId').value;

 var url = "<?php echo U('Mob/Sign/signTimeSetting');?>";

 if(signEndTime<signStartTime)
 {
  toast.error('签到结束时间不能小于开始时间!');
  return false;
 }





  $.post(url, {signStartTime: signStartTime,signEndTime : signEndTime,schooId: schooId,orgaId:orgaId}, function (msg) {
                if (msg.status == 1) {
                   toast.success(msg.msg);
                    parent.location.reload();

                } else {
                    toast.error(msg.msg);

                }
            }, 'json')




 });

</script>
  <?php else: ?>
<div align="center"><h3>没有可管理年级</h3></div><?php endif; ?>



</div>



        <!-- /主体 -->

        <!-- 底部 -->
        <div class="hide-foot am-text-center" style="display: none"><!-- 用于加载统计代码等隐藏元素 -->
    <?php echo ($count_code); ?>
    
</div>
        <!-- /底部 -->
    </body>
</html>